package com.d0323;

import java.util.Scanner;

public class HomeWork {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字字符串:");
        String str=sc.next();
        char []array=str.toCharArray();//字符串转为字符数组
        int[] a =new int[array.length];
        int num=0;
        int num1=0;
        for (int i = 0; i <array.length ; i++) {
            a[i]=(int)array[i];
            if(a[i]%2==0){
                num++;
            }else{
                num1++;
            }
        }
        System.out.println("偶数个数为:"+num);
        System.out.println("奇数个数为:"+num1);
    }
}
